package com.example.wan1.view.web;

import android.content.Context;
import android.content.Intent;

import com.example.wan1.view.MainActivity;
import com.example.wan1.view.login.LoginActivity;
import com.example.wan1.view.search.SearchActivity;

/***
 * 创建时间：2020/7/19 21:55
 * 创建人：10850
 * 功能描述：跳转到WebView
 */
public class JumpTool {

    public static void goWeb(Context context, String... strings) {
        Intent intent = new Intent(context, WebActivity.class);
        intent.putExtra("title", strings[0]);
        intent.putExtra("url", strings[1]);
        context.startActivity(intent);
    }

    public static void goSearch(Context context, String type) {
        goSearch(context, type, -1);
    }

    public static void goSearch(Context context, String type, int id) {
        Intent intent = new Intent(context, SearchActivity.class);
        intent.putExtra("type", type);
        intent.putExtra("id", id);
        context.startActivity(intent);
    }

    public static void goHome(Context context) {
        Intent intent = new Intent(context, MainActivity.class);
        context.startActivity(intent);
    }

    public static void goLogin(Context context) {
        context.startActivity(new Intent(context, LoginActivity.class));
    }
}
